package edu.java.homework.hw03.introJava11;

import java.util.Arrays;
import java.util.Scanner;
import java.util.ArrayList;

;

public class Test {

   final int age;
   private String nameSubject="Math";
   private String[] students=null;
    
   private Test(){
       age=3;
   }
    public Test(String lectureName, String... students){
	this();
	this.nameSubject=lectureName;
	this.students=students;
    }
    
    public static void main(String[] args) {

	// --- class System ----------------------------------------------------
	// int sum = 0;
	// long startTime = System.currentTimeMillis();
	// for (int i = 0; i < 1000000; i++) {
	// sum++;
	// }
	// long endTime = System.currentTimeMillis();
	// System.out.printf("The spent time for calculation is: %.5f seconds",
	// (endTime - startTime) / 1000.0);

	// --- class Math ------------------------------------------------------
	// Scanner input= new Scanner(System.in);
	// System.out.print("First side= ");
	// double firstSide=input.nextDouble();
	// System.out.print("Second side= ");
	// double secondSide=input.nextDouble();
	// System.out.print("Angle in degrees: ");
	// int angle=input.nextInt();
	// double face=0.5*firstSide*secondSide*Math.sin(Math.toRadians(angle));
	// System.out.printf("Face of the triangle: %f", face);

	// System.out.println(Math.PI);
	// System.out.println(Math.E);

	// --- class Random ----------------------------------------------------
	// Random rand= new Random();
	// for(int i=1;i<=6;i++){
	// int randNumber=rand.nextInt(49)+1;
	// System.out.printf("%d  ",randNumber);

	// --- packages --------------------------------------------------------
//	Scanner input = new Scanner(System.in);
//	ArrayList<Integer> ints = new ArrayList<Integer>();
//	ArrayList<Double> doubles = new ArrayList<Double>();
//
//	System.out.println("Enter some sequence from integers and doubles");
//
//	while (true) {
//	    if (input.hasNextInt()) {
//		ints.add(input.nextInt());
//	    } else if (input.hasNextDouble()) {
//		doubles.add(input.nextDouble());
//	    } else {
//		break;
//	    }
//	}
//	System.out.println("The integer sequence: " + ints.toString());
//	System.out.println("The double sequence: " + doubles.toString());
   
	// ---------------------------------------------------------------------
	
//	Test myTest=new Test();
//	System.out.println(myTest.age);
//	
//	Test lecture= new Test("Math", "Ginka", "Penka");
//	System.out.println(lecture.nameSubject);
//	System.out.println(Arrays.toString(lecture.students));
//	System.out.println(lecture.age);
	
//	final Test myTest=new Test();
//	System.out.printf("nameSubject= %s\n", myTest.getNameSubject() );
//	
//	myTest.setNameSubject("Literature");
//	System.out.printf("nameSubject= %s\n", myTest.getNameSubject() );
	
	Test myTest= new Test("Biology", "Penka", "Fenka");
	myTest.print();
	myTest.testFinalModifier(myTest);
	System.out.println();
	myTest.print();
	
    
    }
    public void setNameSubject(String nameSubject) {
        this.nameSubject = nameSubject;
    }
    public String getNameSubject() {
        return nameSubject;
    }
    
    public void testFinalModifier(final Test tst){
//	tst=new Test();
//	tst.setNameSubject("Geology");
	tst.print();
    }
    
    public void print(){
	System.out.println(this.getNameSubject());
	System.out.println(Arrays.toString(this.students));
    }
    
}
